import {Base} from '../../utils/base.js';
class Model extends Base{
  constructor(){
    super();
  }

  /**
   * 获取分类
   * @param {*} success 
   * @param {*} fail 
   */
  getCategory(success,fail){
    this.request({
      url: '/get_integral_category',
      success: (res)=>{
        success&&success(res);
      },
      fail:(res)=>{
        fail&&fail(res);
      }
    });
  }

  // 获取用户积分
  getUserIntegral(callback){
    this.request({
      url: '/get_integral',
      success: function (res) {
        callback && callback(res)
      },
      fail: function (res) {
        callback && callback(res)
      }
    })
  }

  // 获取积分商城列表
  getIntegralList(callback){
    this.request({
      url:'/get_integral_list',
      success:function(res){
        callback&& callback(res)
      },
      fail:function(res){
        callback && callback(res)
      }
    })
  }

}
export{Model}